home *** CD-ROM | disk | FTP | other *** search
/ Future Workshop / Future Workshop.iso / utility / formula1 / vcform1.3 / VB4 / ODBC1 / ODBC1.frm (.txt) next >
Encoding:
Visual Basic Form  |  1995-09-15  |  9.8 KB  |  306 lines

  1. VERSION 4.00
  2. Begin VB.Form Form1 
  3.    BorderStyle     =   3  'Fixed Dialog
  4.    Caption         =   "ODBC Toy"
  5.    ClientHeight    =   6435
  6.    ClientLeft      =   1140
  7.    ClientTop       =   1785
  8.    ClientWidth     =   9435
  9.    Height          =   7185
  10.    Icon            =   "ODBC1.frx":0000
  11.    Left            =   1050
  12.    LinkTopic       =   "Form1"
  13.    MaxButton       =   0   'False
  14.    MinButton       =   0   'False
  15.    ScaleHeight     =   6435
  16.    ScaleWidth      =   9435
  17.    ShowInTaskbar   =   0   'False
  18.    Top             =   1125
  19.    Width           =   9615
  20.    Begin VB.Frame Frame2 
  21.       Caption         =   "Sheet Formatting"
  22.       Height          =   2475
  23.       Left            =   7320
  24.       TabIndex        =   6
  25.       Top             =   3840
  26.       Width           =   1995
  27.       Begin VB.TextBox txtNumSheets 
  28.          Height          =   285
  29.          Left            =   1020
  30.          TabIndex        =   14
  31.          Text            =   "4"
  32.          Top             =   1080
  33.          Width           =   675
  34.       End
  35.       Begin VB.TextBox txtNumCols 
  36.          Height          =   285
  37.          Left            =   1020
  38.          TabIndex        =   13
  39.          Text            =   "256"
  40.          Top             =   720
  41.          Width           =   675
  42.       End
  43.       Begin VB.TextBox txtNumRows 
  44.          Height          =   285
  45.          Left            =   1020
  46.          TabIndex        =   12
  47.          Text            =   "16384"
  48.          Top             =   360
  49.          Width           =   675
  50.       End
  51.       Begin VB.CommandButton cmdInitTable 
  52.          Caption         =   "Init Sheet"
  53.          Height          =   315
  54.          Left            =   360
  55.          TabIndex        =   11
  56.          Top             =   1980
  57.          Width           =   1335
  58.       End
  59.       Begin VB.CommandButton cmdSetFormats 
  60.          Caption         =   "Set Formats"
  61.          Height          =   315
  62.          Left            =   360
  63.          TabIndex        =   10
  64.          Top             =   1560
  65.          Width           =   1335
  66.       End
  67.       Begin VB.Label Label3 
  68.          Alignment       =   1  'Right Justify
  69.          Caption         =   "Sheets = "
  70.          Height          =   255
  71.          Left            =   180
  72.          TabIndex        =   9
  73.          Top             =   1140
  74.          Width           =   795
  75.       End
  76.       Begin VB.Label Label2 
  77.          Alignment       =   1  'Right Justify
  78.          Caption         =   "Cols = "
  79.          Height          =   255
  80.          Left            =   180
  81.          TabIndex        =   8
  82.          Top             =   780
  83.          Width           =   795
  84.       End
  85.       Begin VB.Label Label1 
  86.          Alignment       =   1  'Right Justify
  87.          Caption         =   "Rows = "
  88.          Height          =   255
  89.          Left            =   180
  90.          TabIndex        =   7
  91.          Top             =   420
  92.          Width           =   795
  93.       End
  94.    End
  95.    Begin VB.Frame Frame1 
  96.       Caption         =   "Query Options"
  97.       Height          =   2475
  98.       Left            =   120
  99.       TabIndex        =   1
  100.       Top             =   3840
  101.       Width           =   6975
  102.       Begin VB.Frame Frame3 
  103.          Caption         =   "Query"
  104.          Height          =   1995
  105.          Left            =   1980
  106.          TabIndex        =   17
  107.          Top             =   300
  108.          Width           =   4815
  109.          Begin VB.ComboBox cboQueries 
  110.             Enabled         =   0   'False
  111.             Height          =   300
  112.             ItemData        =   "ODBC1.frx":044A
  113.             Left            =   480
  114.             List            =   "ODBC1.frx":045A
  115.             TabIndex        =   18
  116.             Text            =   "Select * From Authors"
  117.             Top             =   960
  118.             Width           =   4155
  119.          End
  120.          Begin Threed.SSOption optUseQuery 
  121.             Height          =   195
  122.             Left            =   240
  123.             TabIndex        =   20
  124.             Top             =   660
  125.             Width           =   1095
  126.             _Version        =   65536
  127.             _ExtentX        =   1931
  128.             _ExtentY        =   344
  129.             _StockProps     =   78
  130.             Caption         =   "Use Query:"
  131.          End
  132.          Begin Threed.SSOption optShowDialog 
  133.             Height          =   195
  134.             Left            =   240
  135.             TabIndex        =   19
  136.             Top             =   360
  137.             Width           =   1215
  138.             _Version        =   65536
  139.             _ExtentX        =   2143
  140.             _ExtentY        =   344
  141.             _StockProps     =   78
  142.             Caption         =   "Show Dialog"
  143.             Value           =   -1  'True
  144.          End
  145.       End
  146.       Begin VB.TextBox txtStartRow 
  147.          Height          =   285
  148.          Left            =   180
  149.          TabIndex        =   16
  150.          Text            =   "1"
  151.          Top             =   1560
  152.          Width           =   615
  153.       End
  154.       Begin VB.TextBox txtStartCol 
  155.          Height          =   285
  156.          Left            =   180
  157.          TabIndex        =   15
  158.          Text            =   "1"
  159.          Top             =   1920
  160.          Width           =   615
  161.       End
  162.       Begin VB.Label Label5 
  163.          Caption         =   "Start Col"
  164.          Height          =   255
  165.          Left            =   900
  166.          TabIndex        =   22
  167.          Top             =   1920
  168.          Width           =   735
  169.       End
  170.       Begin VB.Label Label4 
  171.          Caption         =   "Start Row"
  172.          Height          =   195
  173.          Left            =   900
  174.          TabIndex        =   21
  175.          Top             =   1620
  176.          Width           =   735
  177.       End
  178.       Begin Threed.SSCheck chkSetMaxRC 
  179.          Height          =   195
  180.          Left            =   180
  181.          TabIndex        =   5
  182.          Top             =   1260
  183.          Width           =   1575
  184.          _Version        =   65536
  185.          _ExtentX        =   2778
  186.          _ExtentY        =   344
  187.          _StockProps     =   78
  188.          Caption         =   "Set Max Row/Col"
  189.          Value           =   -1  'True
  190.       End
  191.       Begin Threed.SSCheck chkSetColWidths 
  192.          Height          =   195
  193.          Left            =   180
  194.          TabIndex        =   4
  195.          Top             =   960
  196.          Width           =   1575
  197.          _Version        =   65536
  198.          _ExtentX        =   2778
  199.          _ExtentY        =   344
  200.          _StockProps     =   78
  201.          Caption         =   "Set Col Widths"
  202.          Value           =   -1  'True
  203.       End
  204.       Begin Threed.SSCheck chkSetColFormats 
  205.          Height          =   195
  206.          Left            =   180
  207.          TabIndex        =   3
  208.          Top             =   660
  209.          Width           =   1575
  210.          _Version        =   65536
  211.          _ExtentX        =   2778
  212.          _ExtentY        =   344
  213.          _StockProps     =   78
  214.          Caption         =   "Set Col Formats"
  215.          Value           =   -1  'True
  216.       End
  217.       Begin Threed.SSCheck chkSetColNames 
  218.          Height          =   195
  219.          Left            =   180
  220.          TabIndex        =   2
  221.          Top             =   360
  222.          Width           =   1575
  223.          _Version        =   65536
  224.          _ExtentX        =   2778
  225.          _ExtentY        =   344
  226.          _StockProps     =   78
  227.          Caption         =   "Set Col Names"
  228.          Value           =   -1  'True
  229.       End
  230.    End
  231.    Begin VCIF1Lib.F1Book F1Book1 
  232.       Height          =   3555
  233.       Left            =   120
  234.       TabIndex        =   0
  235.       Top             =   120
  236.       Width           =   9195
  237.       _version        =   65536
  238.       _extentx        =   16219
  239.       _extenty        =   6271
  240.       _stockprops     =   96
  241.       borderstyle     =   1
  242.       appname         =   ""
  243.       filename        =   "ODBC1.frx":04C3
  244.    End
  245.    Begin VB.Menu mnuConnect 
  246.       Caption         =   "Connect!"
  247.    End
  248.    Begin VB.Menu mnuFetch 
  249.       Caption         =   "Fetch!"
  250.    End
  251.    Begin VB.Menu mnuDisconnect 
  252.       Caption         =   "Disconnect!"
  253.    End
  254. Attribute VB_Name = "Form1"
  255. Attribute VB_Creatable = False
  256. Attribute VB_Exposed = False
  257. Option Explicit
  258. Private Sub cmdInitTable_Click()
  259.    ' This will kill a connection with the existing table
  260.    F1Book1.InitTable
  261. End Sub
  262. Private Sub cmdSetFormats_Click()
  263.    On Error GoTo OptionsError
  264.    F1Book1.MaxRow = Val(txtNumRows.Text)
  265.    F1Book1.MaxCol = Val(txtNumCols.Text)
  266.    F1Book1.NumSheets = Val(txtNumSheets.Text)
  267.    Exit Sub
  268. OptionsError:
  269.    MsgBox Error
  270. End Sub
  271. Private Sub mnuConnect_Click()
  272.    On Error GoTo ConnectError
  273.    Dim returnCode%, pConnect$
  274.    F1Book1.ODBCConnect pConnect, True, returnCode
  275.    Exit Sub
  276. ConnectError:
  277.    MsgBox Error
  278. End Sub
  279. Private Sub mnuDisconnect_Click()
  280.    F1Book1.ODBCDisconnect
  281. End Sub
  282. Private Sub mnuFetch_Click()
  283.    On Error GoTo FetchError
  284.    Dim returnCode%, query$
  285.    Dim setColNames As Boolean, setColFormats As Boolean
  286.    Dim setColWidths As Boolean, setMaxRC As Boolean
  287.    Let query = cboQueries.Text
  288.    setColNames = chkSetColNames.Value
  289.    setColFormats = chkSetColFormats.Value
  290.    setColWidths = chkSetColWidths.Value
  291.    setMaxRC = chkSetMaxRC.Value
  292.    F1Book1.ODBCQuery query, Val(txtStartRow.Text), Val(txtStartCol.Text), _
  293.       optShowDialog.Value, setColNames, setColFormats, setColWidths, setMaxRC, returnCode
  294.    Exit Sub
  295. FetchError:
  296.    MsgBox Error
  297. End Sub
  298. Private Sub optUseQuery_Click(Value As Integer)
  299.    ' User will be prompted for query if dialog shown
  300.    cboQueries.Enabled = Value
  301. End Sub
  302. Private Sub optShowDialog_Click(Value As Integer)
  303.    ' User will be prompted for query if dialog shown
  304.    cboQueries.Enabled = Not Value
  305. End Sub
  306.